# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1SerializedPolicyTag do
  @moduledoc """
  A nested protocol buffer that represents a policy tag and all its descendants.

  ## Attributes

  *   `childPolicyTags` (*type:* `list(GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1SerializedPolicyTag.t)`, *default:* `nil`) - Children of the policy tag, if any.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Description of the serialized policy tag. At most 2000 bytes when encoded in UTF-8. If not set, defaults to an empty description.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Required. Display name of the policy tag. At most 200 bytes when encoded in UTF-8.
  *   `policyTag` (*type:* `String.t`, *default:* `nil`) - Resource name of the policy tag. This field is ignored when calling `ImportTaxonomies`.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :childPolicyTags =>
            list(GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1SerializedPolicyTag.t())
            | nil,
          :description => String.t() | nil,
          :displayName => String.t() | nil,
          :policyTag => String.t() | nil
        }

  field(:childPolicyTags,
    as: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1SerializedPolicyTag,
    type: :list
  )

  field(:description)
  field(:displayName)
  field(:policyTag)
end

defimpl Poison.Decoder,
  for: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1SerializedPolicyTag do
  def decode(value, options) do
    GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1SerializedPolicyTag.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.DataCatalog.V1.Model.GoogleCloudDatacatalogV1SerializedPolicyTag do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
